package com.test.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;


import com.test.comment.FightBean;
import com.test.comment.JudgeBean;
import com.test.comment.RaceBean;
import com.test.comment.SingerBean;
import com.test.comment.SingerRaceBean;
import com.test.comment.UserBean;
import com.test.comment.UservoteBean;

@Repository
public interface UserDao {
  UserBean alluser();
  
  //系统管理员查询用户
  UserBean findAllUser();
  //系统管理员添加用户
  boolean insertUser(UserBean userBean);

  int totalrace();
  List<RaceBean> racelimit(@Param("tmp")Integer tmp,@Param("limit")Integer limit);
  //对应比赛人数的总数
  int totalsingerrace(@Param("rid")Integer rid);
  //对应比赛人数的数据
  List<SingerRaceBean> singerrace(@Param("tmp")Integer tmp,@Param("limit")Integer limit,@Param("rid")Integer rid);
  //插入对决表相关信息
  void insertfigth(@Param("raceid")Integer raceid,@Param("singerid1")Integer singerid1,@Param("singerid2")Integer singerid2);
  //验证选手是否在某一场比赛是否已安排对决
  String ex(@Param("raceid")Integer raceid, @Param("singerid")Integer singerid);
  //修改比赛表
  void updaterace(RaceBean raceBean);
  //所有比赛不分页
  List<RaceBean> allra();
  //每场比赛对决表的总数
  int totalracesinger(@Param("rid")Integer rid);
  //对决表
  List<FightBean> allfight(@Param("tmp")int tmp, @Param("limit")Integer limit, @Param("rid")Integer rid);
  //根据选手id查找对应的成绩
  SingerRaceBean achi(@Param("sid")int sid,@Param("rid")int rid);
  //根据对决表的sid差名字
  String SingerName(@Param("sid")int sid);
  //添加比赛信息
  void insertraceinfor(RaceBean raceBean);
  //删除该比赛
  void deleterace(Integer rid);
  //修改对决表的状态
  void updatafight(Integer fid);
  
  String findfight(Integer rid);
  void stopfight(Integer fid);
  List<JudgeBean> findjudge(@Param("sidOne")int sidOne, @Param("rid")Integer rid);
  int finduser(@Param("sidOne")int sidOne, @Param("rid")Integer rid);
  int findusertotal(Integer rid);
  //根据fid找对决表的相关信息
  FightBean fb(Integer fid);
  //将计算的成绩更改表中
  void insertSingerRace(SingerRaceBean singerRaceBean);

  //找到开启的比赛
  FightBean kai();


  int findsingerscore(Integer rid);

 List<SingerRaceBean> singerscore(@Param("tmp")Integer tmp, @Param("limit")Integer limit, @Param("rid")Integer rid);

  int totalfight(Integer rid);

  void deletefights(Integer fid);
  
 
}
